Skip to main content

Simulate Swap

Simulates a swap given the swap parameters.

Request URL

https://testnet.api.euclidprotocol.com/api/v1/simulate-swap

Curl

curl -X 'POST' \
'https://testnet.api.euclidprotocol.com/api/v1/simulate-swap' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"amount_in": "1000000000000000000",
"asset_in": "stt",
"asset_out": "bnb",
"contract": "euclid1ywzqwvhmm58e02lvr579xlcn873kptl40a4teqnjd8t8kndfps7qdghdaq",
"min_amount_out": "1",
"swaps": ["stt","euclid","bnb"]
}'

Parameters

Swap Transaction Details

FieldTypeDescription
amount_inStringThe amount of the asset being swapped in, in micro denoms.
asset_inStringThe Id of the input asset.
asset_outStringThe Id of the output asset.
contractStringThe address of the router contract.
min_amount_outStringThe minimum amount of the output asset for the swap to be considered a success, in micro denoms.
swapsArrayA list of swaps to execute to get from asset_in to asset_out. This is derived from the Routes query.

Example Response

{"amount_out":"57810274463639","asset_out":"bnb"}